import suwell from './ofd/suwell'
import sursen from './ofd/sursen'

function addScriptTag(src: any) {
  const script = document.createElement('script')
  script.setAttribute('type', 'text/javascript')
  script.src = src
  document.body.appendChild(script)
}
addScriptTag('/ofd/sursenReader.js')
addScriptTag('/ofd/suwellOfdReader.js')

let chooseConverter: any = {}
if (window.ofdExt === 'suwell') {
  chooseConverter = suwell
} else if (window.ofdExt === 'sursen') {
  chooseConverter = sursen
}

export default chooseConverter
